home *** CD-ROM | disk | FTP | other *** search
- /*
- * (c) Copyright 1992 by Panagiotis Tsirigotis
- * All rights reserved. The file named COPYRIGHT specifies the terms
- * and conditions for redistribution.
- */
-
- #ifndef DEFS_H
- #define DEFS_H
-
- /*
- * $Id: defs.h,v 5.1 1992/10/31 23:59:07 panos Exp $
- */
-
- #include <memory.h>
-
- #ifndef NULL
- #define NULL 0
- #endif
-
- #ifndef FALSE
- #define FALSE 0
- #define TRUE 1
- #endif
-
- #define NUL '\0'
-
- #define ES_NOMEM "out of memory"
-
- #define INT_NULL ((int *)0)
- #define CHAR_NULL ((char *)0)
- #define VOID_NULL ((char *)0)
- #define FD_SET_NULL ((fd_set *)0)
- #define RUSAGE_NULL ((struct rusage *)0)
- #define TIMEVAL_NULL ((struct timeval *)0)
- #define ITIMERVAL_NULL ((struct itimerval *)0)
- #define SOCKADDRIN_NULL ((struct sockaddr_in *)0)
-
- #define PRIVATE static
-
- #define EQ( s1, s2 ) ( strcmp( s1, s2 ) == 0 )
- #define CLEAR( x ) (void) memset( (char *)&(x), 0, sizeof( x ) )
- #define SA( p ) ( (struct sockaddr *) (p) )
-
- /*
- * Value for unlimited server instances
- */
- #define UNLIMITED (-1)
-
- /*
- * Service port for the identification service
- */
- #define IDENTITY_SERVICE_PORT 113
-
- /*
- * This is the signal sent to interceptor processes to tell them
- * to stop intercepting
- */
- #define INTERCEPT_SIG SIGUSR1
-
- /*
- * This is how many descriptors we reserve for ourselves:
- *
- * 3 for stdin, stdout, stderr
- * 1 for syslog/debug
- *
- * For the rest we just need to reserve the maximum of each category.
- *
- * 1 for doing accepts
- * 1 for registering rpc services (initialization phase)
- * 4 for reading the configuration file during reconfiguration
- * 1 for the configuration file
- * 1 for /etc/passwd
- * 1 for /etc/group
- * 1 for /etc/services, /etc/protocols, /etc/rpc
- * NOTE: We need only 1 descriptor for the last 3 files because
- * the functions get{serv,proto,rpc}byname close the
- * respective files after accessing them.
- * 1 for dumping the internal state
- * 1 for talking to the portmapper (reconfiguration phase)
- *
- * NOTE: we assume that the socket used for pmap_{set,unset} is closed
- * after the operation is completed. If it stays open, then we
- * need to increase DESCRIPTORS_RESERVED.
- */
- #define DESCRIPTORS_RESERVED 8
-
- /*
- * Used for listen(2)
- */
- #define LISTEN_BACKLOG 7
-
- /*
- * When explicit values are given for enum's, that is because the structures
- * that the enum's are in may be initialized by a memory clear operation.
- */
-
- typedef enum { FAILED = 0, OK } status_e ;
- typedef enum { NO = 0, YES } boolean_e ;
-
- typedef int bool_int ;
-
- typedef void (*voidfunc)() ;
-
-
- struct name_value
- {
- char *name ;
- int value ;
- } ;
-
- struct name_value *nv_find_value(), *nv_find_name() ;
-
-
- struct debug
- {
- bool_int on ;
- int fd ;
- } ;
-
- extern struct debug debug ;
-
- #endif /* DEFS_H */
-